import 'package:bpb/framework/base/base_controller.dart';
import 'package:flutter_app_info/package_info_plus.dart';
import 'package:get/get.dart';

class SettingController extends BaseController{


  var versionName="".obs;


  @override
  void onInit() {
    super.onInit();
    getAppVersion();
  }

  Future<void> getAppVersion() async {
    PackageInfo packageInfo = await PackageInfo.fromPlatform();

    String appName = packageInfo.appName;
    String packageName = packageInfo.packageName;
    String version = packageInfo.version;       // 例如 "1.0.0"
    versionName.value=version;
    String buildNumber = packageInfo.buildNumber; // 例如 "1"

    print("App Name: $appName");
    print("Version: $version");
    print("Build Number: $buildNumber");
  }

}